import random

def generate_data(n=8, k=3, max_cookies=20):
    cookies = [random.randint(1, max_cookies) for _ in range(n)]
    return cookies, k

if __name__ == "__main__":
    cookies, k = generate_data()
    print("cookies =", cookies)
    print("k =", k)